package com.yl.project.lvyou.user.service.impl;

import java.util.List;
import com.yl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yl.project.lvyou.user.mapper.ScenicUserMapper;
import com.yl.project.lvyou.user.domain.ScenicUser;
import com.yl.project.lvyou.user.service.IScenicUserService;
import com.yl.common.utils.text.Convert;
import com.yl.framework.config.BaseService;

/**
 * 用户信息Service业务层处理
 * 
 * @author yl
 * @date 2025-03-13
 */
@Service
public class ScenicUserServiceImpl extends BaseService<ScenicUser> implements IScenicUserService 
{
    @Autowired
    private ScenicUserMapper scenicUserMapper;

    /**
     * 查询用户信息
     * 
     * @param id 用户信息ID
     * @return 用户信息
     */
    @Override
    public ScenicUser selectScenicUserById(Long id)
    {
        return scenicUserMapper.selectScenicUserById(id);
    }

    /**
     * 查询用户信息列表
     * 
     * @param scenicUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<ScenicUser> selectScenicUserList(ScenicUser scenicUser)
    {
        return scenicUserMapper.selectScenicUserList(scenicUser);
    }

    /**
     * 新增用户信息
     * 
     * @param scenicUser 用户信息
     * @return 结果
     */
    @Override
    public int insertScenicUser(ScenicUser scenicUser)
    {
        scenicUser.setCreateTime(DateUtils.getNowDate());
        return scenicUserMapper.insertScenicUser(scenicUser);
    }

    /**
     * 修改用户信息
     * 
     * @param scenicUser 用户信息
     * @return 结果
     */
    @Override
    public int updateScenicUser(ScenicUser scenicUser)
    {
        scenicUser.setUpdateTime(DateUtils.getNowDate());
        return scenicUserMapper.updateScenicUser(scenicUser);
    }

    /**
     * 删除用户信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteScenicUserByIds(String ids)
    {
        return scenicUserMapper.deleteScenicUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户信息信息
     * 
     * @param id 用户信息ID
     * @return 结果
     */
    @Override
    public int deleteScenicUserById(Long id)
    {
        return scenicUserMapper.deleteScenicUserById(id);
    }

    @Override
    public ScenicUser selectOneByUserName(String username) {
        return scenicUserMapper.selectOneByUserName(username);
    }
}
